	$(".check2")
	$("#check3")
	$("#check1,#check3").click(function(){
		var isCecked=$(this).prop('checked');
		$(".check2").prop('checked',isCecked);
		$("#check3,#check1").prop('checked',isCecked);
	})
	$("body").on('click','.check2',function(){
		console.log($(".check2").length==$(".check2:checked").length)
		$("#check3,#check1").prop('checked',$(".check2").length==$(".check2:checked").length);
	})		
			
			
	$(".amout-btn").click(function(){
		$(".amout-btn1").css("color","#474747")
		$(".amout-num").text(Number($(".amout-num").text())+1)
		if(Number($(".amout-num").text()) > 5){
			$(".amout-num").text(5);
		    $(".amout-btn").css("color","#bdbdbd")
			
		}
	$(".subTotaloffer").text((Number($(".checkout-product-body-item-unit-sapPrice").text()) * Number($(".amout-num").text())).toFixed(2))
	$(".checkoutSubmit-info-content-right-li-price").text((Number($(".checkout-product-body-item-unit-sapPrice").text()) * Number($(".amout-num").text())).toFixed(2)		)	
	$(".csrcr-value").text((Number($(".checkout-product-body-item-unit-sapPrice").text()) * Number($(".amout-num").text())).toFixed(2))
	
	})
	$(".amout-btn1").click(function(){
		$(".amout-btn").css("color","#474747")
		$(".amout-num").text(Number($(".amout-num").text())-1)
		if(Number($(".amout-num").text()) < 1){
			$(".amout-num").text(1);
		   $(".amout-btn1").css("color","#bdbdbd")
			
		}
		$(".subTotaloffer").text((Number($(".checkout-product-body-item-unit-sapPrice").text()) * Number($(".amout-num").text())).toFixed(2))
		$(".checkoutSubmit-info-content-right-li-price").text((Number($(".checkout-product-body-item-unit-sapPrice").text()) * Number($(".amout-num").text())).toFixed(2)		)
		$(".csrcr-value").text((Number($(".checkout-product-body-item-unit-sapPrice").text()) * Number($(".amout-num").text())).toFixed(2))
	
	})
			
			
$(".checkout-product-body-item-handle-delete").click(function(){
	$(".checkout-product-body-item").css("display","none")
})


// cookie
function getCookie(cname) {
				var name = cname + "=";
				var ca = document.cookie.split(';');
				for (var i = 0; i < ca.length; i++) {
					var c = ca[i].trim();
					var arrC = c.split("=");
					if (arrC[0] == cname) {
						return arrC[1];
					}
				}
				return "";
			}
		
			$(document).ready(function() {
				//读取数据
				var cart = getCookie('cart');
				if (cart) {
					var goodsList = JSON.parse(cart);
					//渲染界面
					var html = '';
					goodsList.forEach(function(item) {
						html += '<div class="checkout-product-body-item-content clear-fix"><input type="checkbox" name=""  value="" class="check2"/><a href="#" class="checkout-product-body-item-img fl"><img src="'+ item.photo +'" ></a><div class="checkout-product-body-item-info fl"><h5 class="hasProduct">'+ item.nameen +'</h5><a href="#" class="checkout-product-body-item-productNameCN">'+ item.namee +'</a><div class="checkout-product-body-item-attr"><span class="checkout-product-body-item-attr-html">规格：'+ item.clas +'  <span class="iconfont icon-pan_icon"></span></span></div></div><div class="checkout-product-body-item-unit fl"><div class="checkout-product-body-item-unit-price"><span class="checkout-product-body-item-unit-sapPrice ">'+ item.price +'</span></div></div><div class="checkout-product-body-item-amount fl"><div class="checkout-product-body-item-amount-warp"><div class="checkout-product-body-item-amount-tips"><span>限购5件</span></div><div class="checkout-product-body-item-amount-module"><span class="amout-btn1">-</span><span class="amout-num">'+ item.num +'</span><span class="amout-btn">+</span></div></div></div><div class="checkout-product-body-item-subtotal fl"><div class="checkout-product-body-item-unit-price"><span class="subTotaloffer">'+ item.price * item.num +'</span></div></div><div class="checkout-product-body-item-handle fl"><div class="checkout-product-body-item-handle-module"><span class="checkout-product-body-item-handle-delete"></span></div></div></div>'
					});
					$(".checkout-product-body-item").html(html)

				}
			})
	